<html>
    <head>
        <link rel="stylesheet" type="text/css" href="../style/css/style.css" media="screen" />
        <script src="../js/jquery-1.6.2.min.js"  type="text/javascript"></script>
        <script  type="text/javascript">
            $( function(){
                validNavigation =true;
                window.print();
                history.back();
            });
        </script>
    </head>
    <body>
        <?php
        @session_start();
        include_once 'transport.php';
//        print_r($_SESSION);
        echo"<center><h1>Extrato&nbsp" . $_SESSION[periodo] . "<br/>" . $_SESSION[xml_data] . "</h1></center><table width='100%' border='0'>
        <tr>
        <td style='width:5%' width='5%'><h3>Entradas:</h3></td>
        <td style='width:5%' width='5%'><h3>Sa&iacute;das:</h3></td>
        <td style='width:10%' width='10%'><h3>Subtotal:</h3></td>
        <td style='width:30%' width='30%'><h3>Descri&ccedil;&atilde;o:</h3></td>
        <td style='width:20%' width='20%'><h3>Categoria:</h3></td>
        <td style='width:10%' width='10%'><h3>Respons&aacute;vel:</h3></td>
        <td style='width:10%' width='10%'><h3>Data:</h3></td>
        <td style='width:10%' width='10%'><h3>Hora:</h3></td>
        </tr>";
        foreach ($_SESSION[xml] as $i => $value) {
            echo "
        <tr " . ($i % 2 == 0 ? "class='linha1'" : "class='linha2'") . " >
       <td style='width:5%' width='5%'>$value[entrada]</td>
       <td style='width:5%' width='5%'>$value[saida]</td>
        <td style='width:10%' width='10%' " . ($value[total] < 0 ? "class='devedor'" : "class='positivo'") . ">$value[total]</td>
        <td style='width:30%' width='30%'>" . utf8_decode($value[produto]) . "</td>
        <td style='width:20%' width='20%'>" . utf8_decode($value[categoria]) . "</td>
        <td style='width:10%' width='10%'>" . utf8_decode($value[usuario]) . "</td>
        <td style='width:10%' width='10%'>$value[data]</td>
        <td style='width:10%' width='10%'>$value[hora]</td> </tr>";
            $total = $value[total];
        }
        echo "<tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td><h3>TOTAL: " . $total . "</h3></td>
        </tr></table>";
        ?>
    </body>
</html>